#include <linux/types.h>
#include <linux/kernel.h>
#include <linux/delay.h>
#include <linux/ide.h>
#include <linux/init.h>
#include <linux/module.h>
#include <linux/errno.h>
#include <linux/gpio.h>
#include <linux/cdev.h>
#include <linux/device.h>
#include <linux/of_gpio.h>
#include <linux/semaphore.h>
#include <linux/timer.h>
#include <linux/i2c.h>
#include <asm/mach/map.h>
#include <asm/uaccess.h>
#include <asm/io.h>
#include <linux/regmap.h>

#include "mpu6050.h"



#define qqname "81qq"
#define qqcnt  1

struct qq_dev
{
    int major;
    int minor;
    dev_t devid;
	struct cdev cdev;
	struct class *class;
	struct device *device;
    struct device_node *nd;
    struct i2c_client *client;
	struct regmap *regmap;
    struct regmap_config regmap_config;
};

static struct qq_dev mydev;

static int qq_open(struct inode *inode, struct file *filp)
{
    filp->private_data = &qq_dev;
    return 0;
}

static int qq_release(struct inode *inode, struct file *filp)
{
    return 0;
}

static ssize_t qq_read(struct file *filp, char __user *buf, size_t len, loff_t *off)
{
    struct qq_dev *dev = filp->private_data;
    return 0;
}

static ssize_t qq_write(struct file *filp, const char __user *buf, size_t len, loff_t *off)
{
    struct qq_dev *dev = filp->private_data;
    return 0;
}


static struct file_operations qq_fops =
{
    .owner = THIS_MODULE,
    .open = qq_open,
    .release = qq_release,
    .read = qq_read,
    .write = qq_write,
};


static int qq_probe(struct spi_device *spi)
{
    pirntk("qq_probe\n");

    return 0;

}



static int qq_remove(struct spi_device *spi)
{
    return 0;
}


static const struct spi_device_id qq_id[] =
{
    { "xby,w25q64", 0 },
    { },
};

static const struct of_device_id qq_of_match[] =
{
    { .compatible = "xby,w25q64" },
    { },
};


static struct spi_driver qq_driver =
{
    .driver = 
    {
        .name = "w25q64",
        .of_match_table = qq_of_match,
    },
    .probe = qq_probe,
    .remove = qq_remove,
    .id_table = qq_id,
};

static int __init qq_init(void)
{
    int ret;
    ret = spi_register_driver(&qq_driver);
    if(ret < 0)
    {
        return ret;
    }
    return 0;
}

static void __exit qq_exit(void)
{
    spi_unregister_driver(&qq_driver);
}

module_init(qq_init);
module_exit(qq_exit);
MODULE_LICENSE("GPL");
MODULE_AUTHOR("xueboyu");

